import request from '@/utils/request'

// 查询城市列表
export function listCity(query) {
  return request({
    url: '/system/city/list',
    method: 'get',
    params: query
  })
}

// 查询城市详细
export function getCity(cityId) {
  return request({
    url: 'system/city/cityMsg/'+ cityId,
    method: 'get'
  })
}
//类别
export function gettypelist() {
  return request({
    url: '/system/type/list',
    method: 'get'
  })
}
// 新增城市
export function addCity(data) {
  return request({
    url: '/system/city/addNewCity',
    method: 'post',
    data: data
  })
}

// 修改城市
export function updateCity(data) {
  return request({
    url: '/system/city/updateCity',
    method: 'put',
    data: data
  })
}

// 删除城市
export function delCity(cityId) {
  return request({
    url: '/system/city/deleteCity/' + cityId,
    method: 'delete'
  })
}
//拿到关联表
export function getType(cityId) {
  return request({
    url: '/system/city/cityService',
    method: 'post',
    data:{
      cityId:cityId
    }
  })
}

// 导出城市
export function exportCity(query) {
  return request({
    url: '/system/city/export',
    method: 'get',
    params: query
  })
}
//修改
export function updateCityService(data) {
  return request({
    url: '/city/type/updateCityService',
    method: 'post',
    data: data
  })
}
